package cn.fastoo.web.backstage.web.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;


public class BaseController implements AutoMappingController{
	 
	@RequestMapping("/auto/{path}")
	public String dianpuUser(@PathVariable String path,HttpServletRequest request){
		return String.format("%s/%s", this.getViewPrefixPath(),path);
	}
	 

	@Override
	public String getMobileViewPrefixPath() {
		Class<?> clazz = this.getClass();
		RequestMapping requestMapping = clazz.getAnnotation(RequestMapping.class);
		String mapingPath = requestMapping.value()[0];
		return mapingPath;
	};
	
	@Override
	public String getViewPrefixPath() {
		Class<?> clazz = this.getClass();
		RequestMapping requestMapping = clazz.getAnnotation(RequestMapping.class);
		String mapingPath = requestMapping.value()[0];
		return mapingPath;
	};
	
}
